3.79 \(\int \frac{\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx\)

Optimal. Leaf size=116 \[ -\frac{i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{x}{16 a^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{8 d (a+i a \tan (c+d x))^4} \]

[Out]

-x/(16*a^4) - (I/8)/(d*(a + I*a*Tan[c + d*x])^4) + (I/4)/(a*d*(a + I*a*Tan[c + d*x])^3) - (I/16)/(d*(a^2 + I*a
^2*Tan[c + d*x])^2) - (I/16)/(d*(a^4 + I*a^4*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.119034, antiderivative size = 116, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3540, 3526, 3479, 8} \[ -\frac{i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{x}{16 a^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{8 d (a+i a \tan (c+d x))^4} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

-x/(16*a^4) - (I/8)/(d*(a + I*a*Tan[c + d*x])^4) + (I/4)/(a*d*(a + I*a*Tan[c + d*x])^3) - (I/16)/(d*(a^2 + I*a
^2*Tan[c + d*x])^2) - (I/16)/(d*(a^4 + I*a^4*Tan[c + d*x]))

Rule 3540

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> -Simp[
(b*(a*c + b*d)^2*(a + b*Tan[e + f*x])^m)/(2*a^3*f*m), x] + Dist[1/(2*a^2), Int[(a + b*Tan[e + f*x])^(m + 1)*Si
mp[a*c^2 - 2*b*c*d + a*d^2 - 2*b*d^2*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0] && LeQ[m, -1] && EqQ[a^2 + b^2, 0]

Rule 3526

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^m)/(2*a*f*m), x] + Dist[(b*c + a*d)/(2*a*b), Int[(a + b*Tan[e + f*x])^(m + 1),
 x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0]

Rule 3479

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(a + b*Tan[c + d*x])^n)/(2*b*d*n), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\tan ^2(c+d x)}{(a+i a \tan (c+d x))^4} \, dx &=-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{\int \frac{a-2 i a \tan (c+d x)}{(a+i a \tan (c+d x))^3} \, dx}{2 a^2}\\ &=-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{\int \frac{1}{(a+i a \tan (c+d x))^2} \, dx}{4 a^2}\\ &=-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{\int \frac{1}{a+i a \tan (c+d x)} \, dx}{8 a^3}\\ &=-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}-\frac{\int 1 \, dx}{16 a^4}\\ &=-\frac{x}{16 a^4}-\frac{i}{8 d (a+i a \tan (c+d x))^4}+\frac{i}{4 a d (a+i a \tan (c+d x))^3}-\frac{i}{16 d \left (a^2+i a^2 \tan (c+d x)\right )^2}-\frac{i}{16 d \left (a^4+i a^4 \tan (c+d x)\right )}\\ \end{align*}

Mathematica [A]  time = 0.387729, size = 69, normalized size = 0.59 \[ -\frac{(\cos (4 (c+d x))-i \sin (4 (c+d x))) ((1+8 i d x) \sin (4 (c+d x))+(8 d x+i) \cos (4 (c+d x))-4 i)}{128 a^4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^2/(a + I*a*Tan[c + d*x])^4,x]

[Out]

-((Cos[4*(c + d*x)] - I*Sin[4*(c + d*x)])*(-4*I + (I + 8*d*x)*Cos[4*(c + d*x)] + (1 + (8*I)*d*x)*Sin[4*(c + d*
x)]))/(128*a^4*d)

________________________________________________________________________________________

Maple [A]  time = 0.026, size = 118, normalized size = 1. \begin{align*}{\frac{{\frac{i}{16}}}{d{a}^{4} \left ( \tan \left ( dx+c \right ) -i \right ) ^{2}}}-{\frac{{\frac{i}{8}}}{d{a}^{4} \left ( \tan \left ( dx+c \right ) -i \right ) ^{4}}}+{\frac{{\frac{i}{32}}\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{d{a}^{4}}}-{\frac{1}{4\,d{a}^{4} \left ( \tan \left ( dx+c \right ) -i \right ) ^{3}}}-{\frac{1}{16\,d{a}^{4} \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{{\frac{i}{32}}\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{d{a}^{4}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x)

[Out]

1/16*I/d/a^4/(tan(d*x+c)-I)^2-1/8*I/d/a^4/(tan(d*x+c)-I)^4+1/32*I/d/a^4*ln(tan(d*x+c)-I)-1/4/d/a^4/(tan(d*x+c)
-I)^3-1/16/d/a^4/(tan(d*x+c)-I)-1/32*I/d/a^4*ln(tan(d*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.52891, size = 128, normalized size = 1.1 \begin{align*} -\frac{{\left (8 \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 4 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + i\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{128 \, a^{4} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

-1/128*(8*d*x*e^(8*I*d*x + 8*I*c) - 4*I*e^(4*I*d*x + 4*I*c) + I)*e^(-8*I*d*x - 8*I*c)/(a^4*d)

________________________________________________________________________________________

Sympy [A]  time = 1.12666, size = 119, normalized size = 1.03 \begin{align*} \begin{cases} \frac{\left (128 i a^{4} d e^{8 i c} e^{- 4 i d x} - 32 i a^{4} d e^{4 i c} e^{- 8 i d x}\right ) e^{- 12 i c}}{4096 a^{8} d^{2}} & \text{for}\: 4096 a^{8} d^{2} e^{12 i c} \neq 0 \\x \left (- \frac{\left (e^{8 i c} - 2 e^{4 i c} + 1\right ) e^{- 8 i c}}{16 a^{4}} + \frac{1}{16 a^{4}}\right ) & \text{otherwise} \end{cases} - \frac{x}{16 a^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+I*a*tan(d*x+c))**4,x)

[Out]

Piecewise(((128*I*a**4*d*exp(8*I*c)*exp(-4*I*d*x) - 32*I*a**4*d*exp(4*I*c)*exp(-8*I*d*x))*exp(-12*I*c)/(4096*a
**8*d**2), Ne(4096*a**8*d**2*exp(12*I*c), 0)), (x*(-(exp(8*I*c) - 2*exp(4*I*c) + 1)*exp(-8*I*c)/(16*a**4) + 1/
(16*a**4)), True)) - x/(16*a**4)

________________________________________________________________________________________

Giac [A]  time = 1.55757, size = 117, normalized size = 1.01 \begin{align*} -\frac{\frac{2 i \, \log \left (-i \, \tan \left (2 \, d x + 2 \, c\right ) + 1\right )}{a^{4}} - \frac{2 i \, \log \left (-i \, \tan \left (2 \, d x + 2 \, c\right ) - 1\right )}{a^{4}} + \frac{3 i \, \tan \left (2 \, d x + 2 \, c\right )^{2} - 6 \, \tan \left (2 \, d x + 2 \, c\right ) + 5 i}{a^{4}{\left (\tan \left (2 \, d x + 2 \, c\right ) - i\right )}^{2}}}{128 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

-1/128*(2*I*log(-I*tan(2*d*x + 2*c) + 1)/a^4 - 2*I*log(-I*tan(2*d*x + 2*c) - 1)/a^4 + (3*I*tan(2*d*x + 2*c)^2
- 6*tan(2*d*x + 2*c) + 5*I)/(a^4*(tan(2*d*x + 2*c) - I)^2))/d